﻿default_created_by = 'db/seeds.rb'

###############################################################################
# Top Level Categories (level 1)
###############################################################################
category_bachelor_thesis = Category.create(
	order_position: 1,
	created_by: default_created_by
)
category_bachelor_thesis.translations.create(name: 'Bachelor thesis', description: 'Shrubbery!', locale: 'en')
category_bachelor_thesis.translations.create(name: 'Bachelorarbeiten', description: 'Blub narf!', locale: 'de')

category_master_thesis = Category.create(
	order_position: 2,
	created_by: default_created_by
)
category_master_thesis.translations.create(name: 'Master thesis', description: 'Shrubbery!', locale: 'en')
category_master_thesis.translations.create(name: 'Masterarbeiten', description: 'Blub narf!', locale: 'de')

category_diploma_thesis = Category.create(
	order_position: 3,
	created_by: default_created_by
)
category_diploma_thesis.translations.create(name: 'Diploma thesis', description: 'Shrubbery!', locale: 'en')
category_diploma_thesis.translations.create(name: 'Diplomarbeiten', description: 'Blub narf!', locale: 'de')

category_internal_projects = Category.create(
	order_position: 4,
	created_by: default_created_by
)
category_internal_projects.translations.create(name: 'Internal projects', description: 'Shrubbery!', locale: 'en')
category_internal_projects.translations.create(name: 'Interne Projekte', description: 'Blub narf!', locale: 'de')

category_external_projects = Category.create(
	order_position: 5,
	created_by: default_created_by
)
category_external_projects.translations.create(name: 'External projects', description: 'Shrubbery!', locale: 'en')
category_external_projects.translations.create(name: 'Externe Projekte', description: 'Blub narf!', locale: 'de')


###############################################################################
# Sub-Categories (level 2)
###############################################################################
category_bachelor_thesis_mi = Category.create(
	order_position: 1,
	parent: category_bachelor_thesis,
	created_by: default_created_by
)
category_bachelor_thesis_mi.translations.create(name: 'Mediainformatics', description: 'Shrubbery!', locale: 'en')
category_bachelor_thesis_mi.translations.create(name: 'Medieninformatik', description: 'Blub narf!', locale: 'de')

category_bachelor_thesis_in = Category.create(
	order_position: 2,
	parent: category_bachelor_thesis,
	created_by: default_created_by
)
category_bachelor_thesis_in.translations.create(name: 'Informatics', description: 'Shrubbery!', locale: 'en')
category_bachelor_thesis_in.translations.create(name: 'Informatik', description: 'Blub narf!', locale: 'de')

category_master_thesis_mi = Category.create(
	order_position: 1,
	parent: category_master_thesis,
	created_by: default_created_by
)
category_master_thesis_mi.translations.create(name: 'Mediainformatics', description: 'Shrubbery!', locale: 'en')
category_master_thesis_mi.translations.create(name: 'Medieninformatik', description: 'Blub narf!', locale: 'de')

category_master_thesis_in = Category.create(
	order_position: 2,
	parent: category_master_thesis,
	created_by: default_created_by
)
category_master_thesis_in.translations.create(name: 'Informatics', description: 'Shrubbery!', locale: 'en')
category_master_thesis_in.translations.create(name: 'Informatik', description: 'Blub narf!', locale: 'de')


###############################################################################
# DEVELOPMENT ENVIRONMENT SETTINGS
###############################################################################

if false
	doc1 = Document.create(
		authors: 'Max Mustermann',
		publication_date: Date.today,
		related_work: 'Design patterns, Headfirst into Design Patterns',
		owner_id: 1,
		created_by: default_created_by
	)
	doc1.categories << category_bachelor_thesis
	doc1.categories << category_internal_projects
	doc1.translations.create(name: 'Sample Document #1', 
		description: 'This is a sample document for testing purposes.',
		locale: 'en')
	doc1.translations.create(name: 'Beispieldokument #1', 
		description: 'Dies ist ein Beispieldokument für Testzwecke.',
		locale: 'de')
	
	doc2 = Document.create(
		authors: 'Sabine Kauffrau',
		publication_date: Date.today,
		related_work: 'Rechnungswesen by Hamlet',
		owner_id: 1,
		created_by: default_created_by
	)
	doc2.categories << category_bachelor_thesis
	doc2.categories << category_internal_projects
	doc2.translations.create(name: 'Sample Document #2', 
		description: 'This is a sample document for testing purposes.',
		locale: 'en')
	doc2.translations.create(name: 'Beispieldokument #2', 
		description: 'Dies ist ein Beispieldokument für Testzwecke.',
		locale: 'de')
end